<template>
	<view class="cake-item margin-bottom">
		<image :src="gdata.img" mode=""></image>
		<view class="flex justify-between align-center padding-lr-sm">
			<view class="">
				<view class="text-lg margin-top-sm">
					{{gdata.name}}
				</view>
				<view class="text-xs margin-tb-xs">
					{{gdata.french}}
				</view>
			</view>
			<view class="cu-avatar round bg-yellow" @click="handlePop">
				<text class="iconfont icon-gouwuche"></text>
			</view>
		</view>
		<view class="text-price padding-lr-sm">
			{{gdata.price}}
		</view>
	</view>
</template>

<script>
	export default {
		// created() {
		// 	console.log('组件的created');
		// }
		props: {
			gdata: {
				type: Object,
				required:true 
			},
		},
		methods: {
			handlePop() {
				this.$store.commit('cart/popShowMut',true)
				this.$store.commit('cart/popDataMut',this.gdata)
				this.$store.commit('cart/editIdxMut',-1)
			}
		},
	}
</script>

<style lang="scss">
	.cake-item{
		width: 354upx;
		image{
			width: 100%;
			height: 354upx;
		}
	}
</style>